using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CreamXStudio.Screens
{
    public partial class EditorDialog : Form
    {
        public EditorDialog()
        {
            InitializeComponent();
        }
        static EditorDialog _singleton=null;
        public static void LoadEditor(EditorControlBase ctrl,object data)
        {
            _singleton= new EditorDialog();
            ctrl.ObjectSaved += new EventHandler(ctrl_ObjectSaved);

            _singleton.Controls.Add(ctrl);
            ctrl.SetData(data);
            _singleton.Width = ctrl.Width;
            _singleton.Height = ctrl.Height;
            ctrl.Dock = DockStyle.Fill;
            _singleton.ShowDialog();
        }

        static void ctrl_ObjectSaved(object sender, EventArgs e)
        {
            _singleton.Close();
        }

        
    }
}